<template>
    <el-drawer :title="titleMap[mode]" v-model="visible" :size="400" destroy-on-close @closed="$emit('closed')" :align-center="true">
        <el-container>
            <el-main class="nopadding" style="margin:0 15px">
                <el-timeline>
                    <el-timeline-item v-for="(item, index) in process_data" :key="index">
                        <!-- <div>{{ item.process_title }} ——— {{ item.two_process_title }}</div>
                        <div>{{item.referred_as}}-{{ item.staff_name }}-{{item.mobile}} </div> -->
                        <div>{{item.create_time}}-{{item.staff_name}} : {{item.two_process_title}}</div>
                    </el-timeline-item>
                </el-timeline>
            </el-main>
            <el-footer>
                <div style="display: flex;justify-content: end;">
                    <el-button @click="visible=false" >取 消</el-button>
                </div>
            </el-footer>
        </el-container>
    </el-drawer>
</template>

<script>
	export default {
		emits: ['success', 'closed'],
		data() {
			return {
				mode: "add",
				titleMap: {
					add: '添加客户',
					edit: '编辑客户',
					show: '详情'
				},
				visible: false,
                process_data:[]
			}
		},
		mounted() {
		},
		methods: {
			//显示
			open(mode='add'){
				this.mode = mode;
				this.visible = true;
				return this
			},
			//表单提交方法
			submit(){
                this.visible = false;
			},
			//表单注入数据
			async setData(data){
                var res = await this.$API.develop.edition.templateScheduleDetail.get({order_no:data.order_no});
                console.log('res :>> ', res);
                this.process_data = res.data
			},
		}
	}
</script>

<style lang="scss">
.el-form-item--default{
    align-items: center;
}
</style>
